- dplyr was used to manipulate the data
- ggplo2 was used to create figures
- tidyr was not used since the data was already arranged to desired standards
library(dplyr) library(ggplot2)
library(dplyr) library(ggplot2)
data_1 <- read.csv("https://ndownloader.figshare.com/files/16851587")
knitr::kable(data_1[1:5,1:3])
| species | appendage | mass |
|---|---|---|
| falcatus | smasher | 0.24 |
| falcatus | smasher | 0.93 |
| falcatus | smasher | 0.30 |
| falcatus | smasher | 1.12 |
| falcatus | smasher | 1.20 |
Mantis Shrimp Shells
The coefficient of restitution (COR), also denoted by (e), is the ratio of the final to initial relative velocity between two objects after they collide
can also be viewed in terms of kinetic energy before and after a collision.
e is usually a positive number between 0 and 1:
e = 0: This is a perfectly inelastic collision. Kinetic energy is dissipated (converted to heat or work).
0 < e < 1: This is a real-world inelastic collision, in which some kinetic energy is dissipated.
e = 1: This is a perfectly elastic collision, in which no kinetic energy is dissipated, and the objects rebound from one another with the same initial velocity.
smasher_data <- data_1 %>% group_by(appendage) %>% filter(appendage == "smasher") spearer_data <- data_1 %>% group_by(appendage) %>% filter(appendage != "smasher")
lm_1 <- lm(cor.telson~cor.abdomen, data_1) #linear model function summary(lm_1)[[9]] #number assocaited with chunk, returns r squared value
## [1] 0.1009381
results <- summary(lm_1) results$coefficients[8] #returns p value
## [1] 0.001330482
## [1] 0.1009381
## [1] 0.001330482
## [1] 0.03652613
## [1] 0.06009676
## [1] -0.0254198
## [1] 0.4669373